<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">

    function ajaxFunction()
    {
        var xmlHttp;    //声明一个变量xmlHttp，用于存储XMLHttpRequest对象

        try
        {
            // Firefox, Opera 8.0+, Safari
            xmlHttp=new XMLHttpRequest();
        }
        catch (e)
        {

            // Internet Explorer
            try
            {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch (e)
            {

                try
                {
                    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e)
                {
                    alert("您的浏览器不支持AJAX！");
                    return false;
                }
            }
        }
    }
</script>

<form name="myForm">
  用户: <input type="text" name="username" />
  时间: <input type="text" name="time" />
</form>
</body>
</html>